from dataAccess import getData
from Model import lenModel
from Model import  charModel
from plotUtil import roc
from sklearn.model_selection import train_test_split as tt

# 数据预处理
real=[]
badData=getData.getBad()
goodData=getData.getGood('normalparams','email')
data=badData+goodData
print(goodData)
print(badData)
for x in badData:
    real.append(0)
for x in goodData:
    real.append(1)
lenM=lenModel.lenModel(trainingSet=goodData)
lenM.train()
charM=charModel.charModel(trainingSet=goodData)
charM.train()
lenM.predict(data,real)
charM.predict(data,real)

print(lenM.getMean(),lenM.getStdev(),lenM.getVar())
print(charM.getICDList())
print(lenM.getPredictResult())
print(charM.getPredictResult())
tprandfpr=roc.generateScore((data,real),charM.predict,charM.getPositiveRate()[0:10])
print(tprandfpr)
